From: kfraser@localhost.localdomain Date: Thu, 27 Jul 2006 13:06:15 +0000 (+0100) Subject: Revert previous changeset. Needs more review. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15786^2~1^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=9314b23b0173f4e4db2840b993ae0aa5077f2b3f;p=xen.git Revert previous changeset. Needs more review. Signed-off-by: Keir Fraser --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/common.h b/linux-2.6-xen-sparse/drivers/xen/netback/common.h index dd0b7dd820..c52aaa5f6c 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/common.h +++ b/linux-2.6-xen-sparse/drivers/xen/netback/common.h @@ -87,7 +87,7 @@ typedef struct netif_st { /* Miscellaneous private stuff. */ enum { DISCONNECTED, DISCONNECTING, CONNECTED } status; - + int active; struct list_head list; /* scheduling list */ atomic_t refcnt; struct net_device *dev; diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c index 14ded171f7..f52e2601b7 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c @@ -37,7 +37,9 @@ static void __netif_up(netif_t *netif) { struct net_device *dev = netif->dev; - netif_carrier_on(dev); + netif_tx_lock_bh(dev); + netif->active = 1; + netif_tx_unlock_bh(dev); enable_irq(netif->irq); netif_schedule_work(netif); } @@ -47,7 +49,7 @@ static void __netif_down(netif_t *netif) struct net_device *dev = netif->dev; disable_irq(netif->irq); netif_tx_lock_bh(dev); - netif_carrier_off(dev); + netif->active = 0; netif_tx_unlock_bh(dev); netif_deschedule_work(netif); } @@ -91,8 +93,6 @@ netif_t *netif_alloc(domid_t domid, unsigned int handle, u8 be_mac[ETH_ALEN]) return ERR_PTR(-ENOMEM); } - netif_carrier_off(dev); - netif = netdev_priv(dev); memset(netif, 0, sizeof(*netif)); netif->domid = domid; diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c index 76a32519ef..6795bcd3af 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c @@ -143,7 +143,7 @@ int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev) BUG_ON(skb->dev != dev); /* Drop the packet if the target domain has no receive buffers. */ - if (unlikely(!netif_carrier_ok(dev)) || + if (!netif->active || (netif->rx_req_cons_peek == netif->rx.sring->req_prod) || ((netif->rx_req_cons_peek - netif->rx.rsp_prod_pvt) == NET_RX_RING_SIZE)) @@ -404,8 +404,7 @@ static void add_to_net_schedule_list_tail(netif_t *netif) return; spin_lock_irq(&net_schedule_list_lock); - if (!__on_net_schedule_list(netif) && - likely(netif_carrier_ok(netif->dev))) { + if (!__on_net_schedule_list(netif) && netif->active) { list_add_tail(&netif->list, &net_schedule_list); netif_get(netif); }